feat: add cryptoNetwork field to RealtimeFundingQuoteSource#236
feat: add cryptoNetwork field to RealtimeFundingQuoteSource#236
Conversation
Callers depositing stablecoins (USDC, USDT) via realtime funding need to specify which network they are depositing on so the correct vault deposit address can be generated. Without this field, the server would have to guess or hardcode the network. cryptoNetwork is optional for backward compatibility — existing fiat realtime funding sources (USD, MXN, etc.) are unaffected. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
Greptile SummaryAdded optional
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/quotes/RealtimeFundingQuoteSource.yaml | Added optional cryptoNetwork field with clear documentation and examples for stablecoin network selection |
| openapi.yaml | Generated bundle correctly updated with new cryptoNetwork field from source schema |
| mintlify/openapi.yaml | Generated bundle correctly updated with new cryptoNetwork field for documentation |
Last reviewed commit: a14bb9d
| for the full list of supported fiat and crypto currencies. | ||
| example: USD | ||
| cryptoNetwork: | ||
| type: string |
There was a problem hiding this comment.
@wuvictor-95 I thought we were going to return an array of all supported networks in the quote response payment instructions?
There was a problem hiding this comment.
It's what we are doing currently since we only have one network. In the future though, as we expand our capabilities to many networks, it makes less sense to do. We wouldn't want to create 3+ garbage deposit addresses for different networks everytime we create a quote
There was a problem hiding this comment.
Oh man. This is another breaking change. And I thought address generation was cheap and we were going to use that pattern for other payment instructions.
There was a problem hiding this comment.
This could be handled via config e.g. platform specifies which networks they care about when funding payments. Default is solana.
Yea, it's cheap but not 0. We have to check in each address to be watched on Alchemy, and alchemy has limits. It's definitely not scalable to, say, spin up 5 addresses for every payment. But perhaps we can manage that complexity and clean up all the addresses after 24 hours.
There was a problem hiding this comment.
It's better to get breaking changes in now. I do think it's a better experience to be able to accept across multiple chains. As an example if I'm depositing to Uniswap, I generate the address once and can send to it from any network. Vs needing to specify the network prior to address generation.
There was a problem hiding this comment.
It's not a breaking change if it's totally optional and we return all configured networks even when the currency is a stablecoin.
The description below makes it seem required when currency is any stablecoin
There was a problem hiding this comment.
We should make a call here. IMO, we should just merge this and in the short term if it's empty we can return all available (we only support solana right now anyway). I want to unblock @kphurley7 to merge this.
There was a problem hiding this comment.
We should make a call here. IMO, we should just merge this and in the short term if it's empty we can return all available (we only support solana right now anyway). I want to unblock @kphurley7 to merge this.
There was a problem hiding this comment.
yeah, based on victor's response I thought we were going to make this optional even for crypto currencies and return all available? That decision makes sense to me
There was a problem hiding this comment.
Right now we are returning a list of payment instructions.
The PR description seems like this was auto-created since we're hardcoding to create a solana address in paycore. This is intended. We will hardcode networks in the backend since the original strategy was to just return a list of networks anyways.
I think we can close this PR. If we want to add CryptoNetwork as a optional field later on, we can. Not sure what work this is blocking though.
Summary
Adds an optional
cryptoNetworkfield toRealtimeFundingQuoteSource.Callers depositing stablecoins (USDC, USDT) via realtime funding need to specify which network they are depositing on so the server can generate a deposit address on the correct network. Without this field, the server has to hardcode the network (e.g. Solana devnet for sandbox), which won't work when production supports multiple networks.
The field is optional for backward compatibility — existing fiat realtime funding sources (USD, MXN, etc.) are unaffected.
Usage
{ "source": { "sourceType": "REALTIME_FUNDING", "currency": "USDC", "cryptoNetwork": "SOLANA_MAINNET", "customerId": "Customer:..." } }Test plan
cryptoNetworkrequired)cryptoNetwork: "SOLANA_MAINNET"returns a Solana deposit addressmake lint)🤖 Generated with Claude Code